
import { HttpTemplateList } from '../../../service/notice';
import TableList from "../../../components/templates/tablelist";
import mixin from '../mixin';
export default {
    mixins: [TableList, mixin],
    data() {
        return {
            isMixin: true,
            Searchs: {
                show: true,
                style: "border:none;",
                labelWidth: "auto",
                align: "left"
            },
        };
    },
    methods: {
        ajaxRequest: HttpTemplateList,
        handleOperates(data) {
            this.$emit('on-data', data)
        },
    },
    computed: {
        SearchsData() {
            return [
                {
                    label: "消息类型",
                    tag: 'Select',
                    key: 'EQ_bizeventTypeId',
                    show: true,
                    options: this.getNoticeEevntTypes,
                },
                {
                    label: "模板名称",
                    key: 'CN_title',
                    tag: 'Input',
                    show: true,
                },
                {
                    label: "状态",
                    tag: 'Select',
                    key: 'EQ_status',
                    options: this.getTemplateStatus,
                },
                {
                    label: "模板描述",
                    key: 'EQ_brief',
                    tag: 'Input',
                    show: true,
                },
            ]
        },
        columns() {
            return [
                {
                    title: '模板名称',
                    key: 'title',
                }, {
                    title: '模板描述',
                    key: 'brief',
                }, {
                    title: '类型',
                    key: 'bizeventTypeId',
                    render: (h, { row }) => this.findRenderLabel(this.getNoticeEevntTypes, row.bizeventTypeId),
                }, {
                    title: '状态',
                    key: 'active',
                    render: (h, { row }) => this.findRenderLabel(this.getTemplateStatus, row.active),
                }, {
                    title: "操作",
                    width: 120,
                    align: "center",
                    render: (h, { row }) => {
                        return <Button type="primary" onClick={this.handleOperates.bind(this, row)}>选择</Button>
                    }
                }];
        },
    },
};




